home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 344 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: johnw@jove.acs.unt.edu (John R. Williams)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: #ifdef XXXX
  5. Date: 08 Feb 1996 15:57:47 PST
  6. Organization: University of North Texas
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4fe1jt$scn@hermes.acs.unt.edu>
  9. References: <1996Feb1.092058.4745@iiasa.ac.at>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: 8 Feb 1996 23:39:41 GMT
  12. X-Newsreader: TIN [version 1.2 PL2]
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMRqODEy4NqrwXLNJAQFAXwH9FV/+TCB5sLG/f+KZ6eQQ2y5fOWagVz97
  15.     0Nde8ll8de5hVS4wCAMzseD5+Uhnfum/oqxwG0Mw2+ikNh6AYgBJSw==
  16.     =gy3i
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. Marek  MAKOWSKI (marek@iiasa.ac.at) wrote:
  20. > Would not it be sensible to add to the preprocessing a directive
  21. > that would stop processing the current file ? Something like
  22.  
  23. > #ifdef XXXX
  24. > #exit
  25.  
  26. > this would safe processing (sometimes very long) file in the common
  27. > situations:
  28.  
  29. > #ifdef XXXX
  30. > // a (possibly) long header file hear
  31. > #endif  /* ifdef XXXX*/
  32.  
  33. I think it would be even better to make "#pragma once" (a common C 
  34. extension, AFAIK) into a standardized directive ("#once"?). This would 
  35. probably save an average of 30 characters per header (the most annoying 
  36. ones in the whole language(s), IMO).
  37.  
  38. OTOH I can see how #exit would have good uses.
  39.  
  40. Also something I have often wished for was something like #warning which 
  41. would cause the compiler to emit a warning.
  42. ---
  43. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  44.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  45.   in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
  46.